package io.wdb.wxapp.model;

import java.io.Serializable;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;

import io.swagger.annotations.ApiModelProperty;

import io.wdb.modules.activity.wxapp.entity.HdScanConfigEntity;


/**
 * 扫码地推配置
 * 
 * @author wdb
 * @email xulin@wdb007.com
 * @date 2018-02-01 16:57:29
 */
public class HdScanConfigModel implements Serializable {
	private static final long serialVersionUID = 1L;
	
	@ApiModelProperty(value = "", required = true)
	private String id;
	@ApiModelProperty(value = "二维码地点", required = true)
	private String area;
	@ApiModelProperty(value = "所属工作人员", required = true)
	private String worker;
	@ApiModelProperty(value = "赠送金额(分)", required = true)
	private Integer money;
	@ApiModelProperty(value = "活动时间", required = true)
	private Date createTime;
	@ApiModelProperty(value = "渠道ID,1地推扫码", required = true)
	private Date modifyTime;
	@ApiModelProperty(value = "当前地推渠道默认1", required = true)
	private Integer channel;
	@ApiModelProperty(value = "限制领取次数,是否允许重复领取", required = true)
	private Integer limitTimes;
	@ApiModelProperty(value = "默认有效1、无效0", required = true)
	private Integer status;

	/**
	 * 设置：
	 */
	public void setId(String id) {
		this.id = id;
	}
	/**
	 * 获取：
	 */
	public String getId() {
		return id;
	}
	/**
	 * 设置：二维码地点
	 */
	public void setArea(String area) {
		this.area = area;
	}
	/**
	 * 获取：二维码地点
	 */
	public String getArea() {
		return area;
	}
	/**
	 * 设置：所属工作人员
	 */
	public void setWorker(String worker) {
		this.worker = worker;
	}
	/**
	 * 获取：所属工作人员
	 */
	public String getWorker() {
		return worker;
	}
	/**
	 * 设置：赠送金额(分)
	 */
	public void setMoney(Integer money) {
		this.money = money;
	}
	/**
	 * 获取：赠送金额(分)
	 */
	public Integer getMoney() {
		return money;
	}
	/**
	 * 设置：活动时间
	 */
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	/**
	 * 获取：活动时间
	 */
	public Date getCreateTime() {
		return createTime;
	}
	/**
	 * 设置：渠道ID,1地推扫码
	 */
	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}
	/**
	 * 获取：渠道ID,1地推扫码
	 */
	public Date getModifyTime() {
		return modifyTime;
	}
	/**
	 * 设置：当前地推渠道默认1
	 */
	public void setChannel(Integer channel) {
		this.channel = channel;
	}
	/**
	 * 获取：当前地推渠道默认1
	 */
	public Integer getChannel() {
		return channel;
	}
	/**
	 * 设置：限制领取次数,是否允许重复领取
	 */
	public void setLimitTimes(Integer limitTimes) {
		this.limitTimes = limitTimes;
	}
	/**
	 * 获取：限制领取次数,是否允许重复领取
	 */
	public Integer getLimitTimes() {
		return limitTimes;
	}
	/**
	 * 设置：默认有效1、无效0
	 */
	public void setStatus(Integer status) {
		this.status = status;
	}
	/**
	 * 获取：默认有效1、无效0
	 */
	public Integer getStatus() {
		return status;
	}

    public static HdScanConfigModel convert(HdScanConfigEntity entity) {
		if(entity == null) {
			return null;
		}
		HdScanConfigModel model = new HdScanConfigModel();
				model.setId(entity.getId());
				model.setArea(entity.getArea());
				model.setWorker(entity.getWorker());
				model.setMoney(entity.getMoney());
				model.setCreateTime(entity.getCreateTime());
				model.setModifyTime(entity.getModifyTime());
				model.setChannel(entity.getChannel());
				model.setLimitTimes(entity.getLimitTimes());
				model.setStatus(entity.getStatus());
				
		return model;
	}
	public static List<HdScanConfigModel> convert(List<HdScanConfigEntity> entities){
		if(entities == null || entities.isEmpty()) {
			return null;
		}
		List<HdScanConfigModel> models = new ArrayList<>();
		
		for(HdScanConfigEntity entity:entities) {
			models.add(convert(entity));
		}
		
		return models;
	}
	
	public static HdScanConfigEntity convert(HdScanConfigModel model) {
		if(model == null) {
			return null;
		}
		HdScanConfigEntity entity = new HdScanConfigEntity();
				entity.setId(model.getId());
				entity.setArea(model.getArea());
				entity.setWorker(model.getWorker());
				entity.setMoney(model.getMoney());
				entity.setCreateTime(model.getCreateTime());
				entity.setModifyTime(model.getModifyTime());
				entity.setChannel(model.getChannel());
				entity.setLimitTimes(model.getLimitTimes());
				entity.setStatus(model.getStatus());
				
		return entity;
	}

}
